package com.dong.multithreading;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class TimerTest {

    public static void main(String[] args) {
        Timer timer = new Timer();
        timer.schedule(new PrintTask(), 3000, 10000);
    }

    public static class PrintTask extends TimerTask {
        @Override
        public void run() {
            System.out.println("执行定时任务" + new Date());
        }
    }
}